home *** CD-ROM | disk | FTP | other *** search
/ PC World 1999 April / PCWorld_1999-04_cd.bin / Software / Vyzkuste / LearnVB5 / VB Code / Class 3 / Example3-2.frm (.txt) < prev    next >
Visual Basic Form  |  1998-04-14  |  7KB  |  217 lines

  1. VERSION 5.00
  2. Begin VB.Form frmPizza 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Pizza Order"
  5.    ClientHeight    =   3510
  6.    ClientLeft      =   1140
  7.    ClientTop       =   1515
  8.    ClientWidth     =   5445
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    PaletteMode     =   1  'UseZOrder
  13.    ScaleHeight     =   3510
  14.    ScaleWidth      =   5445
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.OptionButton optWhere 
  17.       Caption         =   "Take Out"
  18.       Height          =   495
  19.       Index           =   1
  20.       Left            =   3600
  21.       TabIndex        =   17
  22.       Top             =   2040
  23.       Width           =   1215
  24.    End
  25.    Begin VB.OptionButton optWhere 
  26.       Caption         =   "Eat In"
  27.       Height          =   495
  28.       Index           =   0
  29.       Left            =   2160
  30.       TabIndex        =   16
  31.       Top             =   2040
  32.       Value           =   -1  'True
  33.       Width           =   1215
  34.    End
  35.    Begin VB.CommandButton cmdExit 
  36.       Caption         =   "E&xit"
  37.       Height          =   495
  38.       Left            =   3000
  39.       TabIndex        =   15
  40.       Top             =   2760
  41.       Width           =   1215
  42.    End
  43.    Begin VB.CommandButton cmdBuild 
  44.       Caption         =   "&Build Pizza"
  45.       Height          =   495
  46.       Left            =   1200
  47.       TabIndex        =   14
  48.       Top             =   2760
  49.       Width           =   1215
  50.    End
  51.    Begin VB.Frame Frame3 
  52.       Caption         =   "Toppings"
  53.       Height          =   1695
  54.       Left            =   2040
  55.       TabIndex        =   7
  56.       Top             =   120
  57.       Width           =   3255
  58.       Begin VB.CheckBox chkTop 
  59.          Caption         =   "Tomatoes"
  60.          Height          =   255
  61.          Index           =   5
  62.          Left            =   1680
  63.          TabIndex        =   13
  64.          Top             =   1200
  65.          Width           =   1335
  66.       End
  67.       Begin VB.CheckBox chkTop 
  68.          Caption         =   "Green Peppers"
  69.          Height          =   255
  70.          Index           =   4
  71.          Left            =   1680
  72.          TabIndex        =   12
  73.          Top             =   840
  74.          Width           =   1455
  75.       End
  76.       Begin VB.CheckBox chkTop 
  77.          Caption         =   "Onions"
  78.          Height          =   375
  79.          Index           =   3
  80.          Left            =   1680
  81.          TabIndex        =   11
  82.          Top             =   360
  83.          Width           =   1335
  84.       End
  85.       Begin VB.CheckBox chkTop 
  86.          Caption         =   "Black Olives"
  87.          Height          =   255
  88.          Index           =   2
  89.          Left            =   240
  90.          TabIndex        =   10
  91.          Top             =   1200
  92.          Width           =   1215
  93.       End
  94.       Begin VB.CheckBox chkTop 
  95.          Caption         =   "Mushrooms"
  96.          Height          =   255
  97.          Index           =   1
  98.          Left            =   240
  99.          TabIndex        =   9
  100.          Top             =   840
  101.          Width           =   1335
  102.       End
  103.       Begin VB.CheckBox chkTop 
  104.          Caption         =   "Extra Cheese"
  105.          Height          =   375
  106.          Index           =   0
  107.          Left            =   240
  108.          TabIndex        =   8
  109.          Top             =   360
  110.          Width           =   1455
  111.       End
  112.    End
  113.    Begin VB.Frame Frame2 
  114.       Caption         =   "Crust Type"
  115.       Height          =   975
  116.       Left            =   120
  117.       TabIndex        =   1
  118.       Top             =   1680
  119.       Width           =   1815
  120.       Begin VB.OptionButton optCrust 
  121.          Caption         =   "Thick Crust"
  122.          Height          =   192
  123.          Index           =   1
  124.          Left            =   240
  125.          TabIndex        =   6
  126.          Top             =   600
  127.          Width           =   1212
  128.       End
  129.       Begin VB.OptionButton optCrust 
  130.          Caption         =   "Thin Crust"
  131.          Height          =   255
  132.          Index           =   0
  133.          Left            =   240
  134.          TabIndex        =   5
  135.          Top             =   240
  136.          Value           =   -1  'True
  137.          Width           =   1095
  138.       End
  139.    End
  140.    Begin VB.Frame Frame1 
  141.       Caption         =   "Size"
  142.       Height          =   1455
  143.       Left            =   120
  144.       TabIndex        =   0
  145.       Top             =   120
  146.       Width           =   1815
  147.       Begin VB.OptionButton optSize 
  148.          Caption         =   "Large"
  149.          Height          =   255
  150.          Index           =   2
  151.          Left            =   240
  152.          TabIndex        =   4
  153.          Top             =   960
  154.          Width           =   1335
  155.       End
  156.       Begin VB.OptionButton optSize 
  157.          Caption         =   "Medium"
  158.          Height          =   255
  159.          Index           =   1
  160.          Left            =   240
  161.          TabIndex        =   3
  162.          Top             =   600
  163.          Width           =   1335
  164.       End
  165.       Begin VB.OptionButton optSize 
  166.          Caption         =   "Small"
  167.          Height          =   255
  168.          Index           =   0
  169.          Left            =   240
  170.          TabIndex        =   2
  171.          Top             =   240
  172.          Value           =   -1  'True
  173.          Width           =   1335
  174.       End
  175.    End
  176. Attribute VB_Name = "frmPizza"
  177. Attribute VB_GlobalNameSpace = False
  178. Attribute VB_Creatable = False
  179. Attribute VB_PredeclaredId = True
  180. Attribute VB_Exposed = False
  181. Option Explicit
  182. Dim PizzaSize As String
  183. Dim PizzaCrust As String
  184. Dim PizzaWhere As String
  185. Private Sub cmdBuild_Click()
  186. 'This procedure builds a message box that displays your pizza type
  187. Dim Message As String
  188. Dim I As Integer
  189. Message = PizzaWhere + vbCr
  190. Message = Message + PizzaSize + " Pizza" + vbCr
  191. Message = Message + PizzaCrust + vbCr
  192. For I = 0 To 5
  193.   If chkTop(I).Value = vbChecked Then Message = Message + chkTop(I).Caption + vbCr
  194. Next I
  195. MsgBox Message, vbOKOnly, "Your Pizza"
  196. End Sub
  197. Private Sub cmdExit_Click()
  198. End Sub
  199. Private Sub Form_Load()
  200. 'Initialize pizza parameters
  201. PizzaSize = "Small"
  202. PizzaCrust = "Thin Crust"
  203. PizzaWhere = "Eat In"
  204. End Sub
  205. Private Sub optCrust_Click(Index As Integer)
  206. 'Read crust type
  207. PizzaCrust = optCrust(Index).Caption
  208. End Sub
  209. Private Sub optSize_Click(Index As Integer)
  210. 'Read pizza size
  211. PizzaSize = optSize(Index).Caption
  212. End Sub
  213. Private Sub optWhere_Click(Index As Integer)
  214. 'Read pizza eating location
  215. PizzaWhere = optWhere(Index).Caption
  216. End Sub
  217.